package com.aube.plugin.origin;

import com.aube.plugin.detail.WidgetDesc;
import com.aube.plugin.detail.WidgetTalent;
import com.aube.plugin.draw.WidgetDraw;
import com.aube.plugin.episode.VideoWidget;
import com.aube.plugin.figure.WidgetFigure;
import com.aube.plugin.previous.WidgetPrevious;

/**
 * 集成在origin module的模块
 * Created by huyaonan on 16/10/13.
 */
public class ModuleLauncher {

    public static boolean isInThisPackage(String code) {
        if(code == null || code.isEmpty())
            return false;

        return code.equalsIgnoreCase("episode")
                || code.equalsIgnoreCase("personal")
                || code.equalsIgnoreCase("actor")
                || code.equalsIgnoreCase("draw")
                || code.equalsIgnoreCase("actordesc")
                || code.equalsIgnoreCase("extention_actor")
                || code.equalsIgnoreCase("previous");
    }

    public static String getClassName(String code) {
        if(code.equalsIgnoreCase("episode"))
            return VideoWidget.class.getName();
        else if(code.equalsIgnoreCase("personal") || code.equalsIgnoreCase("actor"))
            return WidgetFigure.class.getName();
        else if(code.equalsIgnoreCase("draw"))
            return WidgetDraw.class.getName();
        else if(code.equalsIgnoreCase("actordesc"))
            return WidgetDesc.class.getName();
        else if(code.equalsIgnoreCase("extention_actor"))
            return WidgetTalent.class.getName();
        else if(code.equalsIgnoreCase("previous"))
            return WidgetPrevious.class.getName();
        return null;
    }

    public static String getLaunchClass(String code) {
        if(code.equalsIgnoreCase("stagephoto")) {
            return "com.aube.plugin.gallery.GalleryInflate";
        } else if(code.equalsIgnoreCase("actor_week_rank")) {
            return "com.aube.plugin.rank.RankInflate";
        } else {
            return null;
        }
    }

}
